#!/bin/bash

echo -e "\e[1;33m[root@localhost ~]# nvme list\e[0m"
nvme list
echo "---------------------------------------"
echo "---------------------------------------"

nvme list | grep "/dev/nvme" | while read line; do
    device=$(echo $line | awk '{print $1}')
    echo -e "\e[1;33m[root@localhost ~]# nvme id-ctrl $device\e[0m"
    nvme id-ctrl  $device
    echo "---------------------------------------"

    echo -e "\e[1;33m[root@localhost ~]# nvme id-ns $device\e[0m"
    nvme id-ns  $device
    echo "---------------------------------------"
    
    echo -e "\e[1;33m[root@localhost ~]# nvme smart-log $device\e[0m"
    nvme smart-log  $device
    echo "---------------------------------------"
    echo "---------------------------------------"
done

